#include <iostream>
using namespace std;

void swapPtr1(int **p1, int **p2) {
    int *temp = *p1;
    *p1 = *p2;
    *p2 = temp;
}
void swapPtr2(int* &p1, int* &p2) {
    int *temp = p1;
    p1 = p2;
    p2 = temp;
}

int main() {
    int a = 0;
    int b = 1;
    int* pa = &a;
    int* pb = &b;
    cout << "*pa: " << *pa << "\t*pb:" << *pb << endl; 
    swapPtr1(&pa, &pb);
    cout << "*pa: " << *pa << "\t*pb:" << *pb << endl; 
    swapPtr2(pa, pb);
    cout << "*pa: " << *pa << "\t*pb:" << *pb << endl; 

    return 0;
}